home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / Educationƒ / Math⁄Computing / RPNC / RPN Plot / card_2942.txt < prev    next >
Encoding:
Text File  |  1987-10-07  |  4.2 KB  |  127 lines

  1. -- card: 2942 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2620
  5. -- name: 
  6.  
  7.  
  8. -- part 7 (field)
  9. -- low flags: 81
  10. -- high flags: 0000
  11. -- rect: left=181 top=28 right=45 bottom=426
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 65535
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Position
  20.  
  21.  
  22. -- part 8 (field)
  23. -- low flags: 81
  24. -- high flags: 0007
  25. -- rect: left=14 top=27 right=336 bottom=429
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 3
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Info
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   hide card field "Info"
  37. end mouseUp
  38.  
  39.  
  40.  
  41. -- part 11 (button)
  42. -- low flags: 00
  43. -- high flags: 8003
  44. -- rect: left=444 top=221 right=244 bottom=503
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 0 / 0
  47. -- text alignment: 1
  48. -- font id: 0
  49. -- text size: 12
  50. -- style flags: 0
  51. -- line height: 16
  52. -- part name: RunF
  53. ----- HyperTalk script -----
  54. on mouseUp
  55.   set the cursor to 4
  56.   put "" into field "Data"
  57.   put 0 into xstrt   --  CHANGE 0 TO STARTING VALUE OF VARIABLE X
  58.   put 7 into xend    --  CHANGE 7 TO ENDING VALUE OF VARIABLE X
  59.   put .2 into incr   --  CHANGE .2 TO INCREMENT OF X VALUE
  60.   -- CHANGE THE FOLLOWING TO ">=" IF INCR < 0 AND XSTRT > XEND
  61.   repeat while xstrt <= xend
  62.  
  63.     -- REPLACE NEXT LINE WITH YOUR FORMULA (WITH SAME FORMAT)
  64.     put sin(xstrt) into y
  65.     -- END OF (PUT) FORMULA (INTO Y)
  66.  
  67.     put y & "," after last item of field "Data"
  68.     put xstrt + incr into xstrt
  69.   end repeat
  70.   delete last char of field "Data"
  71.   click at location of background button "Line"
  72. end mouseUp
  73.  
  74.  
  75.  
  76. -- part 12 (button)
  77. -- low flags: 00
  78. -- high flags: 8003
  79. -- rect: left=444 top=197 right=220 bottom=503
  80. -- title width / last selected line: 0
  81. -- icon id / first selected line: 0 / 0
  82. -- text alignment: 1
  83. -- font id: 0
  84. -- text size: 12
  85. -- style flags: 0
  86. -- line height: 16
  87. -- part name: Formula
  88. ----- HyperTalk script -----
  89. on mouseUp
  90.   set userLevel to 5
  91.   edit script of button "RunF"
  92.   domenu "compact stack"
  93.   set userLevel to 3
  94. end mouseUp
  95.  
  96.  
  97.  
  98. -- part contents for card part 7
  99. ----- text -----
  100. 26,0.5764
  101.  
  102. -- part contents for card part 8
  103. ----- text -----
  104.                                          Calc Plot
  105.                                      by C. Kingston
  106.  
  107. This is a modified version of the plot stack supplied with HyperCard.  It is designed to accompany the "RPN Calculator" stack.  Or it can be used alone to plot a simple function.
  108.  
  109. When you make a list with the [Lst] key in the RPN calculator program, you may make a line plot of the values in the list by clicking on the plot icon.  That button transfers to this stack, copies the list into the data field, and draws a line graph of the values.
  110.  
  111. The graph is scaled to the data.  If any values extend below zero, a line will be drawn across the graph at the value 0.
  112.  
  113. You may check the location of any point in the graph by holding down the Option key and clicking at the point.  This will display the position in the list of the value plotted in that area, and the abscissa value of the point.  Thus a location display of "1,20" would mean that item 1 of the list is plotted in that area, and the "y" value at the hot spot of the pointer is 20.
  114.  
  115. Clicking on the [Line] button will redo the plot, or will plot new values entered into the data field at the bottom.
  116.  
  117. The buttons [Formula] and [RunF] allow you to plot a function that can be done entirely with the HyperTalk built in functions.   
  118. Click on [Formula] to edit the formula which is contained in the script of button [RunF].  After clicking "OK", click [RunF] to run the function, store the values in the Data field, and draw the plot.  If the function can be done within HyperTalk, this is a lot faster than using the calculator.
  119.  
  120. Eventually more capabilities will be built into this stack, such as axes, X-Y plotting, scatter plots, and so on
  121.  
  122.  
  123.  
  124.  
  125. -- part contents for background part 5
  126. ----- text -----
  127. 0.0000,0.0998,0.1987,0.2955,0.3894,0.4794,0.5646,0.6442,0.7174,0.7833,0.8415,0.8912,0.9320,0.9636,0.9854,0.9975,0.9996,0.9917,0.9738,0.9463,0.9093,0.8632,0.8085,0.7457,0.6755,0.5985,0.5155,0.4274,0.3350,0.2392,0.1411,0.0416,-.0584